package com.yan.kfgl.service.biz.spring;

import ins.yan.framework.model.Page;

import java.util.Date;
import java.util.List;

import com.yan.kfgl.model.Jtext;
import com.yan.kfgl.service.biz.facade.JtextService;
import com.yan.kfgl.service.dao.facade.JtextDaoService;

public class JtextServiceSpringImpl implements JtextService{

	private JtextDaoService jtextDaoService;
	
	public void insertJtext(Jtext jtext) {
		int id = jtextDaoService.findJtextMaxId() + 1;
		jtext.setId(id);
		Date today = new Date();
		jtext.setInsertForHis(today);
		jtext.setUpdateForHis(today);
		jtextDaoService.saveJtext(jtext);
	}

	public void editJtext(Jtext jtext) {
		Date today = new Date();
		jtext.setUpdateForHis(today);
		jtextDaoService.updateJtext(jtext);
		
	}

	public List<Jtext> loadAllJtext() {
		
		return jtextDaoService.findAllJtext();
	}

	public List<Jtext> loadJtextList(Page page , String info) {
		return jtextDaoService.findJtextList(page ,info);
	}

	public Long findJtextListTotalPage(Page page , String info) {
		return jtextDaoService.findJtextListTotalPage(page , info);
	}
	
	public Jtext loadJtextByPK(Jtext jtext) {
		
		return jtextDaoService.findtexteByPK(jtext);
	}

	public List<Jtext> loadJtextEqualByCondition(String condition, Object value) {
		
		return jtextDaoService.findJtextEqualCondition(condition, value);
	}

	public List<Jtext> loadJtextLikeByCondition(String condition, Object value) {
		
		return jtextDaoService.findJtextLikeCondition(condition, value);
	}

	public void dropJtext(Jtext jtext) {
		jtextDaoService.deleteJtextByPk(jtext);
		
	}
	public void dropJtextListByIds(Integer[] ids) {
		List<Jtext> jtexts = jtextDaoService.findJtextListByIds(ids);
		jtextDaoService.deleteJtextList(jtexts);
	}

	public JtextDaoService getJtextDaoService() {
		return jtextDaoService;
	}

	public void setJtextDaoService(JtextDaoService jtextDaoService) {
		this.jtextDaoService = jtextDaoService;
	}

}